home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 07 - 1991 / 07.10 Oct 91 / Jorg October / MainWindow.f < prev   
Encoding:
Text File  |  1991-08-27  |  2.4 KB  |  110 lines  |  [TEXT/MPS ]

  1. ! MainWindow.f 
  2. ! Created 8/27/91 9:37 by AppMaker 
  3.  
  4. !!MP inlines.f
  5. !!G JLtest.finc.f
  6.  
  7. !!D+
  8. !!R+
  9. !!OV+
  10. !!S MainWindow 
  11.  
  12. !----------
  13.     Subroutine OpenMainWindow (fName, vRefNum, fRefNum)
  14.     include 'Globals.inc'
  15.         String*255 fName
  16.     integer*2 vRefNum, fRefNum
  17.     pointer /grafport/ newWindow
  18.     record /rect/ bounds
  19.  
  20.     newWindow = GetNewWindow (MainWindowID, nil, INT4(-1))
  21.     Call SetWTitle (newWindow, %ref(fName))
  22.     Call SetPort (newWindow)
  23.     Call SetNewInfo (newWindow)
  24.         cur^.vScroll.Ctlh = nil
  25.         cur^.hScroll.Ctlh = nil
  26.         cur^.fileNum    = fRefNum
  27.         cur^.volNum    = vRefNum
  28.         cur^.dirty    = .false.
  29.         cur^.filename.shdl = NewString (%ref(fName))
  30.         cur^.windowKind = WMainWindow 
  31.                 cur^.text.TEH    = nil
  32.     !add code here: MainWindow open
  33.     Call ShowWindow (newWindow)
  34.     End !OpenMainWindow 
  35.  
  36. !----------
  37.     Subroutine CloseMainWindow 
  38.     include 'Globals.inc'
  39.  
  40.                 Call DisposHandle (cur^.filename)
  41.     Call DiscardInfo (curWindow)
  42.     !add code here: MainWindow close
  43.     End !CloseMainWindow 
  44.  
  45. !----------
  46.     Subroutine MouseInMainWindow (where, modifiers)
  47.     include 'Globals.inc'
  48.     record /point/ where
  49.     integer*2 modifiers
  50.     record /rect/ bounds
  51.  
  52.          
  53.     !add code here: MainWindow mousedown
  54.     End !MouseInMainWindow 
  55.  
  56. !----------
  57.     Subroutine TypeInMainWindow(ch)
  58.     include 'Globals.inc'
  59.     Character*1 ch
  60.         if (cur^.text.TEH = nil) then 
  61.             Call SysBeep (INT2(1))
  62.         else 
  63.             Call TEKey (ch, cur^.text)
  64.         end if
  65.     !add code here: MainWindow keypress
  66.     End !TypeInMainWindow 
  67.  
  68. !----------
  69.     Subroutine UpdateMainWindow 
  70.     include 'Globals.inc'
  71.     record /rect/ bounds
  72.  
  73.                 Call DrawClippedGrow (Int2(-15), Int2(-15))
  74.     !add code here: MainWindow update 
  75.     End !UpdateMainWindow 
  76.  
  77. !----------
  78.     Subroutine ActivateMainWindow (activate)
  79.     include 'globals.inc'
  80.     logical activate
  81.                 Call DrawClippedGrow (Int2(-15), Int2(-15))
  82.     !add code here: MainWindow activate 
  83.     End !ActivateMainWindow 
  84.  
  85. !----------
  86.     Subroutine ResizeMainWindow 
  87.     include 'globals.inc'
  88.  
  89.     !add code here: MainWindow items resize 
  90.     End !ResizeMainWindow 
  91.  
  92. !----------
  93.     Subroutine ScrollMainWindow (newValue, oldValue)
  94.     include 'globals.inc'
  95.     integer*2 newValue, oldValue
  96.     !add code here: MainWindow scroll 
  97.     End !ScrollMainWindow 
  98.  
  99. !----------
  100.     Subroutine ControlMainWindow (whichControl, whichPart, where)
  101.     include 'globals.inc'
  102.     record /ControlHandle/ whichControl
  103.     Logical*2 TrackButton
  104.     External TrackButton    
  105.         integer*2 whichPart
  106.     record /point/ where
  107.     record /rect/ bounds
  108.  
  109.         End !ControlMainWindow 
  110.